package com.kevin.visitor;

import java.util.ArrayList;
import java.util.List;

/**
 * 对象结构
 *
 * @author kevin
 * @date 2025/8/12
 */
public class ObjectStructure {

    private List<Element> list = new ArrayList<>();

    void accept(Visitor visitor){
        for (Element element : list) {
            element.accept(visitor);
        }
    }

    void add(Element element){
        list.add(element);
    }

    void remove(Element element){
        list.remove(element);
    }
}
